package com.example.demo.OneToMany.service.Impl;


import com.example.demo.OneToMany.entity.School;
import com.example.demo.OneToMany.repository.SchoolRepository;
import com.example.demo.OneToMany.service.SchoolService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class SchoolServiceImpl implements SchoolService {
    @Autowired
    private SchoolRepository schoolRepository;
    @Override
    public List<School> getSchoollist(){
        return schoolRepository.findAll();
    }
    @Override
    public  School getSchoolById(long id){
        return schoolRepository.findById(id);
    }
}
